import request from "@/utils/request"

export function getUserAction () {
  /**
   * dispatch === useDispatch() 更新状态
   * getState === store.getState() 获取store所有数据
   */
  return async (dispatch, getState) => {
    const { data } = await request.get('/user/profile')
    // console.log('用户信息：', data)
    dispatch({
      type: 'get/user',
      user: data
    })
  }
}